package com.yusheng.tr.common.core.openfeign.factory;


import com.yusheng.exceptions.BizException;
import com.yusheng.exceptions.ExceptionEnum;
import com.yusheng.tr.common.core.openfeign.base.ISysRoleFeignService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Collection;

/**
 * @ClassName jiang_jun_qin
 * @date 2023/4/13 17:43
 * @Version 1.0
 */
@Component
public class SysRoleFeignServiceFallback implements FallbackFactory<ISysRoleFeignService> {
    @Override
    public ISysRoleFeignService create(Throwable cause) {
        return new ISysRoleFeignService() {
            @Override
            public Collection<String> selectRolePermissionByUserId(Long userId) {
                throw new BizException(ExceptionEnum.FEIGN_ERROR);
            }
        };
    }
}
